package com.example.sandbox.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author Lierbao
 * @Date 2024/9/4 16:03
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TransferOrder对象")
public abstract class AbstractTransferOrder {
    /**
     * 入账方式
     **/
    public static final String ENTRY_BANK_CARD = "BANK_CARD";
    public static final String ENTRY_PIXCRED_CASH = "PIXCRED_CASH";

    public static final byte STATE_INIT = 0; // 订单生成
    public static final byte STATE_ING = 1; // 转账中
    public static final byte STATE_SUCCESS = 2; // 转账成功
    public static final byte STATE_FAIL = 3; // 转账失败
    public static final byte STATE_CLOSED = 4; // 转账关闭
    public static final byte STATE_REFUND = 5; // 转账退款
    public static final byte STATE_AWAITING_APPROVAL = 6; // 审核中

    public static final byte DEDUCTION_STATE_UNHAPPEN = 0; // 扣款未发生
    public static final byte DEDUCTION_STATE_ING = 1; // 扣款处理中
    public static final byte DIVISION_STATE_FINISH = 2; // 扣款已结束
    public static final byte DIVISION_BACK_STATE_ING = 3; // 代付失败回款处理中
    public static final byte DIVISION_BACK_STATE_FINISH = 4; // 代付失败回款已结束

    public static final byte MANUAL_INTERVENTION_NO_NEED = 0; // 无需人工干预
    public static final byte MANUAL_INTERVENTION_WAIT = 1; // 等待人工干预
    public static final byte MANUAL_INTERVENTION_SUCCESS = 2; // 人工干预为成功
    public static final byte MANUAL_INTERVENTION_FAIL = 3; // 人工干预为失败

    public final static byte NOTIFY_STATE_NO_SEND = 0; // 通知未发送
    public final static byte NOTIFY_STATE_SENT = 1; // 通知已发送
    public final static byte NOTIFY_STATE_SUCCESS = 2; // 通知成功
    public final static byte NOTIFY_STATE_FAIL = 3; // 通知失败

    @ApiModelProperty("转账订单号-系统订单号")
    private String transferId;

    @ApiModelProperty("商户号")
    private String mchNo;

    @ApiModelProperty("服务商号")
    private String isvNo;

    @ApiModelProperty("应用ID")
    private String appId;

    @ApiModelProperty("商户名称")
    private String mchName;

    @ApiModelProperty("类型: 1-普通商户, 2-特约商户(服务商模式)")
    private Byte mchType;

    @ApiModelProperty("商户订单号")
    private String mchOrderNo;

    @ApiModelProperty("支付接口代码")
    private String ifCode;

    @ApiModelProperty("支付渠道代码")
    private String wayCode;

    @ApiModelProperty("入账方式： WX_CASH-微信零钱; ALIPAY_CASH-支付宝转账; BANK_CARD-银行卡")
    private String entryType;

    @ApiModelProperty("转账金额,单位分")
    private Long amount;

    @ApiModelProperty("三位货币代码,人民币:cny")
    private String currency;

    @ApiModelProperty("收款账号")
    private String accountNo;

    @ApiModelProperty("收款人姓名")
    private String accountName;

    @ApiModelProperty("收款人开户行名称")
    private String bankName;

    @ApiModelProperty("转账备注信息")
    private String transferDesc;

    @ApiModelProperty("客户端IP")
    private String clientIp;

    @ApiModelProperty("支付状态: 0-订单生成, 1-转账中, 2-转账成功, 3-转账失败, 4-订单关闭")
    private Byte state;

    @ApiModelProperty("向下游通知状态: 0-通知未发送, 1-通知已发送, 2-通知成功, 3-通知失败 ")
    private Byte notifyState;

    @ApiModelProperty("特定渠道发起额外参数")
    private String channelExtra;

    @ApiModelProperty("渠道订单号")
    private String channelOrderNo;

    @ApiModelProperty("渠道支付错误码")
    private String errCode;

    @ApiModelProperty("渠道支付错误描述")
    private String errMsg;

    @ApiModelProperty("商户扩展参数")
    private String extParam;

    @ApiModelProperty("异步通知地址")
    private String notifyUrl;

    @ApiModelProperty("转账成功时间")
    private Date successTime;

    @ApiModelProperty(value = "创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间")
    private Date updatedAt;

    @ApiModelProperty("转账订单扣款状态：0-扣款未发生, 1-扣款处理中, 2-扣款已结束, 3-代付失败回款处理中,4-代付失败回款已结束")
    private Byte deductionState;

    @ApiModelProperty("最新扣款/回款时间")
    private Date deductionLastTime;

    @ApiModelProperty("代付手续费")
    private Long fee;

    @ApiModelProperty("人工干预状态：无需人工干预 0， 等待人工干预 1，人工干预为成功 2 ，人工干预为失败3")
    private Byte manualInterventionState;

    @ApiModelProperty("人工干预备注")
    private String manualInterventionRemark;

    @ApiModelProperty("人工干预时间")
    private Date manualInterventionTime;

    @ApiModelProperty("支付方式费率")
    private BigDecimal rate;

    @ApiModelProperty(value = "单笔固定金额")
    private Long singleCost;
}
